<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateBuydetailTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		//
		Schema::create('buydetail',function($table){
			$table->increments('id');
			$table->integer('订单号')->unsigned();
			$table->foreign('订单号')->references('id')->on('buy');
			$table->integer('型号')->unsigned();
			$table->foreign('型号')->references('id')->on('cars');
			$table->integer('数量')->unsigned();
			$table->integer('价格')->unsigned();
		    $table->softDeletes();
			$table->timestamps();
		});
	}

	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		//
		Schema::drop('buydetail');
	}

}
